const koaRouter = require('@koa/router')
const { create, remove, update, get, getList } = require('../controller/courseController.js')
const { verifAuth } = require('../middleware/login.middleware.js')

const courseRouter = koaRouter({ prefix: '/course' })
// 增加
courseRouter.post('/', verifAuth, create)
// // 查
courseRouter.get('/:id', get)
courseRouter.get('/', getList)
// // 改
courseRouter.post('/:id', verifAuth, update)
// // 删
courseRouter.delete('/:id', verifAuth, remove)
module.exports = courseRouter
